package com.chezhujie.www.controller;

import com.chezhujie.www.domain.Czjtemp;
import com.chezhujie.www.service.CzjtempService;
import com.xy.user.base.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/czjtempApi")
public class CzjtempApiController extends BaseController<Czjtemp> {

	@Autowired
	private CzjtempService czjtempService;
	
	
	@RequestMapping("list")
	public void list(HttpServletRequest req, HttpServletResponse resp,
			ModelMap model) {

		try {
			List<Map<String, Object>> list = czjtempService.listCzjtemp();
			jsonResult(1, "", "", list, resp);
		} catch (Exception e) {
			e.printStackTrace();
			jsonResult(0, "135", "首页查询模板顺序失败", "", resp);
		}

	}
	
	
}
